package com.eyalsh.data_structures.linkedLists.basic;

/**
 * @author Eyal Shalev
 *
 */
public class LinkedList<T> implements com.eyalsh.data_structures.linkedLists.LinkedList<T> {
	
	/**
	 * Constructor for LinkedList<br>
	 * 
	 */
	public LinkedList() {
	}

	private LinkedListNode<T> head;
	
	@Override
	public LinkedListNode<T> head() {
		return head;
	}
	
	protected void head(LinkedListNode<T> value) {
		head = value;
	}
	
	public void insertHead(T data) {
		LinkedListNode<T> temp = head();
		head(new LinkedListNode<T>(data, this));
		head().next(temp);
	}

	@Override
	public boolean empty() {
		return head() == null;
	}

}
